/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.cvut.fel.taskpro.business.isupport;

import cz.cvut.fel.taskpro.business.support.TaskProException;
import cz.cvut.fel.taskpro.data.entity.Assignment;
import cz.cvut.fel.taskpro.data.entity.AssignmentSubmit;
import cz.cvut.fel.taskpro.data.entity.Kantor;
import cz.cvut.fel.taskpro.data.entity.Student;
import cz.cvut.fel.taskpro.data.entity.TaskProUser;
import java.util.List;
import javax.ejb.Local;

/**
 * This interface specifi e-mail notification actions.
 * @author Tom
 * @version 1.0.0. beta
 */
@Local
public interface IMail {
        /**
         * This method send e-mail via JMS. If occour will show up then
         * TaskProException is invoke, otherwise not.
         * @param mailAddress target adress
         * @param subject subejct of email
         * @param text body of email
         */
      public void sendMessage(String mailAddress, String subject, String text) throws TaskProException;
      /**
       * This method construct an email message which will be send to new user,
       * when they are added. Their generated password is sent as plain text. 
       * @param user users which will be notified
       */
      public void notifyAddUser(List<TaskProUser> user)throws TaskProException;
        /**
       * This method construct an email message which will be send to a user,
       * when the password to user is reset. Their generated password is sent as plain text. 
       * @param password new password in plain text
       * @param user target user
       * @param webAddress webAddress of system
       */
      public void notifyResetPassword(TaskProUser user,String password, String webAddress)throws TaskProException;
      /**
       * This method notify users when new assigmneet is assigned to them.
       * @param assignment assignemnt which was assigned
       * @param user users which will be notified
       */
      public void notifyNewAssignment(List<Student> user,List<Assignment> assignment)throws TaskProException;
      /**
       * This method notify kantor, when a new assignmet is submitted.
       * @param assignmentSubmit assignemnt which was submitted
       * @param kantor kantor who should have rate submiteed assignment
       */
      public void notifySendedAssignment(Kantor kantor,AssignmentSubmit assignmentSubmit)throws TaskProException;
      /**
       * This method construct an email message which will be send to new user,
       * when they are added. Him generated password is sent as plain text. 
       * @param userToNotify  target users to notify
       */
      public void notifyAddUser(TaskProUser userToNotify)throws TaskProException;
      /**
       * This method notify user, whenewer his submitted assignment is rated by kantor
       * @param notifiedAssignmentSubmit task which was rated
       * @param raterKantor katnor who rated task
       */
      public void notifyRateUser(Kantor raterKantor,AssignmentSubmit notifiedAssignmentSubmit)throws TaskProException;
}
